<template>
  <!-- 入库单 -->
  <div>
    <el-tabs v-model="activeId" type="border-card" @tab-click="handleClick">
      <el-tab-pane label="所有订单" name="-1" :disabled="isdisabled"></el-tab-pane>
      <el-tab-pane label="待处理" name="1" :disabled="isdisabled"></el-tab-pane>
      <el-tab-pane label="处理中" name="2" :disabled="isdisabled"></el-tab-pane>
      <el-tab-pane label="已发货" name="3" :disabled="isdisabled"></el-tab-pane>

      <el-tab-pane label="已取消" name="0" :disabled="isdisabled"></el-tab-pane>

      <component :is="view" :tag-index="activeId" @disabled-handler="disabledHandler"></component>
    </el-tabs>
  </div>
</template>

<script>
import OrderView from './components/order-info.vue'

export default {
  components: { OrderView },
  name: 'OrderEntrance',
  data() {
    return {
      activeId: '1',
      view: 'OrderView',
      isdisabled: false,
    }
  },

  methods: {
    handleClick(e) {
      console.log(e.name, '=')
      this.activeId = e.name
    },

    disabledHandler(data) {
      this.isdisabled = data
    },
  },
}
</script>
